// 全局请求封装
import store from '../store/store.js'
// const links = "https://www.jingmizuji.com/pdos"
const links = "http://192.168.1.29:8080"
export default (url, method, params) => {
	return new Promise((resolve, reject) => {
		uni.request({
			url:links + url,
			method: method,
			header: {
				// 'content-type': 'application/x-www-form-urlencoded',
				'token': uni.getStorageSync('token')
				// "TOKEN":'ob4KY3lI4fKMxkyptQr-5AHEaiLsKA73NjQQ8HzBrQCZXRvgM3esQC0MwWB29BFH'
			},
			data: {
				...params
			},
			success(res) {
				if (res.data.code == 401) {

				}
				resolve(res.data);
			},
			fail(err) {
				reject(err);
			},
			complete() {

			}
		});
	});
};